package com.th.admin.actuator.metrics;

import io.micrometer.core.instrument.Gauge;
import io.micrometer.core.instrument.binder.MeterBinder;
import org.springframework.context.annotation.Bean;

import java.util.Queue;

/**
 * @author ThreePure
 * @date 2022/4/23 21:03
 * @description: TODO
 * @since 1.8
 */
public class MyMeterBinderConfiguration {

    @Bean
    public MeterBinder queueSize(Queue queue) {
        return (registry) -> Gauge.builder("queueSize", queue::size).register(registry);
    }

}
